<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>Document</title>

  <style>
    .box {
      width: 300px;
      height: 300px;
      background-image: linear-gradient(to right, rgb(29, 204, 248), rgb(108, 255, 157));
    }
  </style>
</head>

<body>

  <div class="box">

  </div>

  <input type="text">
  <button>切图</button>
  <br>
  <img src="https://www.baidu.com/img/bd_logo1.png?where=super" alt="">

  <script src="./jQuery.js"></script>
  <script>
    //each方法
    let arr = [1, 5, 7, 8, 9, 0, 2]
    $.each(arr, (index, value) => {
      console.log(index, value)
    })

    //trim
    let str1 = '     123    '
    document.write($.trim(str1))

    var res = $.isFunction(jQuery);
    console.log(res);

    $(() => {
      // 编写jQuery相关代码
      // 1.给按钮添加点击事件
      $('button').eq(0).click(()=>{
        let text = $('input').eq(0).val();
        $('img').attr('src',text)
      })
      // 2.获取输入框输入的内容
      // 3.修改img的src属性节点的值
      // $("images").prop("src", text);
    })
  </script>



</body>

</html>